using namespace std;
#include <iostream>

template <class K, class D>
class Record
{
public:
    Record(K kx, D dx) { key = kx; data = dx; }
    K GetKey() { return key; }
    D GetData() { return data; }
protected:
    K key;
    D data;
};

template <class D>
class PrintableRecord : Record<int, D>
{
public:
    PrintableRecord(int kx, D dx) : Record<int, D>::Record(kx, dx) {};
    void printMe();
};

template <class D>
void
PrintableRecord<D>::printMe()
{
    cout << "key : " << Record<int, D>::key << endl;
    cout << "data: " << Record<int, D>::data << endl;
}

int
main(int argc, char *argv[])
{
    Record<int, string> rec(10, "test");

    cout << "Record<int, string> rec(10, \"test\");" << endl;
    cout << "Key : " << rec.GetKey() << endl;
    cout << "Data: " << rec.GetData() << endl << endl;

    PrintableRecord<string> *pr = new PrintableRecord<string>(13, "printable");
    cout << "PrintableRecord<string> pr(13, \"printable\");" << endl;
    pr->printMe();

    return 0;
}

